<?php

/* -----------------------------------------------------------------
 * 	$Id: xtc_word_count.inc.php 866 2014-03-17 12:07:35Z akausch $
 * 	Copyright (c) 2011-2021 commerce:SEO by Webdesign Erfurt
 * 	http://www.commerce-seo.de
 * ------------------------------------------------------------------
 * 	based on:
 * 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
 * 	(c) 2002-2003 osCommerce - www.oscommerce.com
 * 	(c) 2003     nextcommerce - www.nextcommerce.org
 * 	(c) 2005     xt:Commerce - www.xt-commerce.com
 * 	Released under the GNU General Public License
 * --------------------------------------------------------------- */

// Get the number of times a word/character is present in a string
function xtc_word_count($string, $needle) {
    $temp_array = explode($needle, $string);
    return sizeof($temp_array);
}
function xtc_zeichen_count($string, $needle) {
	$needle = "!".str_replace("!", "\!", $needle)."!";
	$temp_array = preg_split($needle, $string);

	return sizeof($temp_array);
}